package com.geega.geetest.core;

import lombok.Data;
import org.springframework.data.domain.Page;

import java.util.List;

@Data
public class PageInfo<T> {

    private List<T> list;

    private Integer pages;

    private Long total;

    public PageInfo(Page<T> page) {
        this.list = page.getContent();
        this.pages = page.getTotalPages();
        this.total = page.getTotalElements();
    }
}
